<template>
    <LayoutWrap class="permission">
        <el-form @submit.native.prevent ref="formSearch" :inline="true" :model="formSearch" label-width="90px">
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="关键词" prop="keyName">
                        <el-select
                            class="custom-the-select_key"
                            popper-class="custom-the-select-popper_key"
                            v-model="formSearch.keyName"
                            placeholder="请选择"
                            style="width: 105px;margin-right: 10px;"
                        >
                            <el-option
                                v-for="item in keyOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                                :disabled="item.disabled"
                            >
                            </el-option>
                        </el-select>
                        <br v-if="isMobile" />
                        <el-input
                            v-model="formSearch.keyValue"
                            placeholder="请输入关键字检索"
                            @keyup.enter.native="getList"
                            style="width: 206px"
                        ></el-input>
                    </el-form-item>
                </div>
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="财务人员" prop="person">
                        <el-select
                            v-model="formSearch.person"
                            filterable
                            clearable
                            placeholder="请选择"
                            style="width: 322px"
                            @keyup.enter.native="getList"
                        >
                            <el-option
                                v-for="item in optionsPersons"
                                :key="item._id"
                                :label="item.name"
                                :value="item._id"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="时间区间" prop="startDate">
                        <el-date-picker
                            type="date"
                            placeholder="选择日期"
                            format="yyyy/MM/dd"
                            prefix-icon="false"
                            v-model="formSearch.startDate"
                            :clearable="true"
                            class="custom-the-datepicker"
                            style="width: 88px;margin-right: 5px;"
                            @change="onChangeDate($event, 'startDate')"
                            @keyup.enter.native="getList"
                        ></el-date-picker>
                        <el-time-select
                            prefix-icon="false"
                            placeholder="起始时间"
                            v-model="formSearch.startTime"
                            class="custom-the-datepicker"
                            style="width: 60px;"
                            :clearable="false"
                            :picker-options="{
                                start: '00:00',
                                step: '01:00',
                                end: '24:00'
                            }"
                            @change="onChangeDate($event, 'startTime')"
                            @keyup.enter.native="getList"
                        >
                        </el-time-select>
                        <span style="display: inline-block; padding: 0 5px;">-</span>
                        <el-date-picker
                            type="date"
                            placeholder="选择日期"
                            format="yyyy/MM/dd"
                            prefix-icon="false"
                            v-model="formSearch.endDate"
                            :clearable="true"
                            class="custom-the-datepicker"
                            style="width: 88px;margin-right: 5px;"
                            @change="onChangeDate($event, 'endDate')"
                            @keyup.enter.native="getList"
                        ></el-date-picker>
                        <el-time-select
                            prefix-icon="false"
                            placeholder="结束时间"
                            v-model="formSearch.endTime"
                            class="custom-the-datepicker"
                            style="width: 60px; margin-right: 5px;"
                            :clearable="false"
                            :picker-options="{
                                start: '00:00',
                                step: '01:00',
                                end: '24:00'
                            }"
                            @change="onChangeDate($event, 'endTime')"
                            @keyup.enter.native="getList"
                        >
                        </el-time-select>
                    </el-form-item>
                </div>
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="时间快捷项" prop="selectMenu">
                        <el-select
                            style="width: 322px"
                            v-model="formSearch.selectMenu"
                            placeholder="请选择"
                            :popper-append-to-body="false"
                            clearable
                            @change="onChangeTimeRange"
                            @clear="onChangeTimeRange('All')"
                            @keyup.enter.native="getList"
                        >
                            <el-option
                                v-for="item in menuOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="时间类型" prop="dateType">
                        <el-select
                            v-model="formSearch.dateType"
                            filterable
                            placeholder="请选择"
                            style="width: 322px"
                            @keyup.enter.native="getList"
                        >
                            <el-option
                                v-for="item in optionsDateTypes"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="排序方式" prop="sortType">
                        <el-select
                            @change="setOrderSortType"
                            v-model="formSearch.sortType"
                            filterable
                            placeholder="请选择"
                            style="width: 322px"
                        >
                            <el-option
                                v-for="item in optionsSortTypes"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="金额范围" prop="numberStart">
                        <el-input
                            v-model="formSearch.numberStart"
                            @keyup.enter.native="getList"
                            style="width: 105px;"
                        ></el-input>
                        <span style="display: inline-block; margin: 0 15px">-</span>
                        <br v-if="isMobile" />
                        <el-input
                            v-model="formSearch.numberEnd"
                            @keyup.enter.native="getList"
                            style="width: 105px;"
                        ></el-input>
                    </el-form-item>
                </div>
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="金额类型" prop="numberType">
                        <el-select v-model="formSearch.numberType" filterable placeholder="请选择" style="width: 322px">
                            <el-option
                                v-for="item in optionsNumberTypes"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="仓库" prop="depot">
                        <el-select
                            v-model="formSearch.depot"
                            filterable
                            clearable
                            placeholder="请选择"
                            style="width: 322px"
                            @keyup.enter.native="getList"
                        >
                            <el-option
                                v-for="item in optionsDepots"
                                :key="item._id"
                                :label="item.name"
                                :value="item._id"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="客户" prop="customer">
                        <el-select
                            v-model="formSearch.customer"
                            filterable
                            clearable
                            placeholder="请选择"
                            style="width: 322px"
                            @keyup.enter.native="getList"
                        >
                            <el-option
                                v-for="item in optionsCustomers"
                                :key="item._id"
                                :label="item.name"
                                :value="item._id"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="账户" prop="account">
                        <el-select
                            v-model="formSearch.account"
                            filterable
                            clearable
                            placeholder="请选择"
                            style="width: 322px"
                            @keyup.enter.native="getList"
                        >
                            <el-option
                                v-for="item in optionsAccounts"
                                :key="item._id"
                                :label="item.name"
                                :value="item._id"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                </div>
            </div>
            <div class="search-wrap">
                <div class="search-item" :class="{left: !isMobile}">
                    <el-form-item label="  ">
                        <el-button type="primary" style="min-width: 120px;" @click="getList">查询</el-button>
                        <br v-if="isMobile" />
                        <el-button type="default" style="min-width: 120px;" @click="resetForm('formSearch')"
                            >重置</el-button
                        >
                    </el-form-item>
                </div>
            </div>
        </el-form>
        <el-table
            v-loading="isLoading"
            :data="tableData"
            border
            style="width: 100%"
            @selection-change="handleSelectionChange"
            ref="multipleUpdateTable"
            :summary-method="getSummaries"
            show-summary
        >
            <el-table-column type="selection" width="55"></el-table-column>
            <el-table-column type="index" :index="indexMethod"></el-table-column>
            <el-table-column prop="documentNo" label="单据编号" sortable>
                <template v-slot="{row}">
                    <TextButton @click="onClickDetail(row, '查看单据')">
                        {{ row.documentNo }}
                    </TextButton>
                </template>
            </el-table-column>
            <el-table-column prop="documentDate" label="单据日期" sortable>
                <template v-slot="{row}">
                    {{ row.documentDate | formatDateFillStr }}
                </template>
            </el-table-column>
            <el-table-column prop="type" label="单据类型" sortable :width="80">
                <template v-slot>
                    <el-tag :type="'1' | showAccountPlayType" disable-transitions>收入</el-tag>
                </template>
            </el-table-column>
            <el-table-column prop="depot" label="仓库" sortable>
                <template v-slot="{row}">
                    {{ row.depotInfo && row.depotInfo.name }}
                </template>
            </el-table-column>
            <el-table-column prop="customer" label="客户" sortable>
                <template v-slot="{row}">
                    {{ row.customerInfo && row.customerInfo.name }}
                </template>
            </el-table-column>
            <el-table-column prop="person" label="财务人员" sortable>
                <template v-slot="{row}">
                    {{ row.personInfo && row.personInfo.name }}
                </template>
            </el-table-column>
            <el-table-column prop="account" label="账户名称" sortable>
                <template v-slot="{row}">
                    {{ row.accountInfo && row.accountInfo.name }}
                </template>
            </el-table-column>
            <el-table-column prop="total" label="单据金额" sortable>
                <template v-slot="{row}">
                    {{ row.total | keep2decimalPlaces }}
                </template>
            </el-table-column>
            <el-table-column prop="remark" label="备注" sortable> </el-table-column>
            <el-table-column prop="operatorDate" label="操作时间" sortable>
                <template v-slot="{row}">
                    {{ row.operatorDate | formatDateFillStr }}
                </template>
            </el-table-column>
            <el-table-column prop="operator" label="操作人" sortable>
                <template v-slot="{row}">{{ row.operator && row.operator.name }}</template>
            </el-table-column>
            <el-table-column prop="date" label="创建时间" sortable>
                <template v-slot="{row}">
                    {{ row.createdAt | formatDateFillStr }}
                </template>
            </el-table-column>
            <!-- <el-table-column align="center" label="操作">
                <template v-slot="{row}">
                    <el-button :disabled="isMultSelect" @click="onClickDetail(row, '查看客户收支流水')" type="text">
                        收支流水
                    </el-button>
                </template>
            </el-table-column> -->
        </el-table>
        <Pagination
            :page-size.sync="formSearch.pageSize"
            :page.sync="formSearch.page"
            :total="formSearch.count"
            @change="onChangePage"
        />
        <FunctionDialog
            :title="title"
            @on-ok="getList"
            :visible.sync="visibleDetail"
            :data-source="dataSourceDetail"
            :optionsPersons="optionsPersons"
            :optionsCustomers="optionsCustomers"
            :optionsProjects="optionsProjects"
            :optionsAccounts="optionsAccounts"
            :optionsDepots="optionsDepots"
        ></FunctionDialog>
    </LayoutWrap>
</template>
<script>
import {mapGetters} from 'vuex';
import {getApiList} from '@/api/itemIn';
import {getApiList as getPersons} from '@/api/person';
import {getApiList as getCustomers} from '@/api/customer';
import {getApiList as getProjects} from '@/api/itemOutIn';
import {getApiList as getAccounts} from '@/api/account';
import {getApiList as getDepots} from '@/api/depot';
import FunctionDialog from '@/views/financial/item-in/FunctionDialog';
import getRules from '@/views/financial/getRules';
import {THE_MOMENT_YYYYMMDD_HHMMSS} from '@/utils/constant';
import {deepCopy} from '@/utils/utils';
import {v4 as uuidv4} from 'uuid';
import moment from 'moment';
const dataSourceDefault = {
    id: undefined,
    documentNo: `SR${moment().format('YYYYMMDDHHmmssSSS')}`,
    documentDate: undefined,
    customer: undefined,
    person: undefined,
    remark: undefined,
    account: undefined,
    total: undefined,
    depot: undefined,
    itemOutIns: [
        {
            uuid: uuidv4(),
            itemOutInId: undefined,
            date: new Date().toISOString(),
            money: undefined,
            abstract: ''
        }
    ]
};

function getOrderSortType() {
    return localStorage.getItem('OrderSortType');
}
function setOrderSortType(value) {
    localStorage.setItem('OrderSortType', value);
}

export default {
    name: 'financial-item-in',
    components: {
        FunctionDialog
    },
    data() {
        return {
            uuidv4,
            THE_MOMENT_YYYYMMDD_HHMMSS,
            formSearch: {
                startDate: '',
                startTime: '',
                endDate: '',
                endTime: '',

                selectMenu: 'All', // 'CustomTime' 'LastWeek',
                person: '',

                numberType: 'total',
                numberStart: '',
                numberEnd: '',

                sortType: getOrderSortType() || 'PositiveOrder',

                dateType: 'documentDate',
                keyName: 'documentNo',

                depot: '',
                customer: '',
                account: '',

                keyValue: '',
                pageSize: 10,
                page: 1,
                count: 0
            },
            keyOptions: [
                {label: '单据编号', value: 'documentNo', disabled: false},
                {label: '备注', value: 'remark', disabled: false}
            ],
            tableData: [],
            isLoading: false,
            dataSourceDefault,
            dataSourceDetail: {...dataSourceDefault, itemOutIns: dataSourceDefault.itemOutIns.map(item => ({...item}))},
            visibleDetail: false,
            title: '添加',
            dialogVisible: false,
            dialogLoading: false,
            multipleSelection: [],
            multipleValueSelection: [],
            multipleDeleteVisible: false, // 批量删除打开、关闭
            isMultipleLoading: false,
            multipleUpdateVisible: false,
            multipleAddVisible: false,
            multipleCreateSelection: [
                {
                    ...dataSourceDefault,
                    itemOutIns: dataSourceDefault.itemOutIns.map(item => ({...item, uuid: uuidv4()})),
                    uuid: uuidv4()
                }
            ],
            RULES: getRules(),
            optionsPersons: [],
            optionsCustomers: [],
            optionsProjects: [],
            optionsAccounts: [],
            optionsDepots: [],
            optionsDateTypes: [
                {label: '单据日期', value: 'documentDate'},
                {label: '操作时间', value: 'operatorDate'},
                {label: '创建时间', value: 'createdAt'}
            ],
            optionsNumberTypes: [{label: '收入金额', value: 'total'}],
            optionsSortTypes: [
                {label: '时间顺序', value: 'PositiveOrder'},
                {label: '时间倒序', value: 'ReverseOrder'}
            ],
            expands: [],
            getRowKeys(row) {
                return row.uuid;
            }
        };
    },
    computed: {
        ...mapGetters({
            isMobile: 'app/isMobile'
        }),
        isMultSelect() {
            return this.multipleSelection.length > 0;
        }
    },
    created() {
        const result = new Array(12).fill('').map((item, index) => {
            const month = (index + 1).toString();
            return {
                label: `${month}月份`,
                value: `${month}`,
                method: (month => () => {
                    month = month.padStart(2, '0');
                    const startDate = moment().format(`YYYY-${month}-01`);
                    const endDate = moment(startDate)
                        .endOf('month')
                        .format('YYYY-MM-DD');

                    this.formSearch = {
                        ...this.formSearch,
                        startDate: startDate,
                        startTime: '00:00',
                        endDate: endDate,
                        endTime: '24:00'
                    };
                })(month)
            };
        });

        this.menuOptions = [
            {
                label: '所有时间',
                value: 'All',
                method: () => {
                    this.formSearch = {
                        ...this.formSearch,
                        startDate: '',
                        startTime: '',
                        endDate: '',
                        endTime: ''
                    };
                }
            },
            {label: '自定义时间', value: 'CustomTime', method: () => {}},
            {
                label: '今天',
                value: 'Today',
                method: () => {
                    const startDate = moment().format('YYYY-MM-DD');
                    const endDate = startDate;

                    this.formSearch = {
                        ...this.formSearch,
                        startDate: startDate,
                        startTime: '00:00',
                        endDate: endDate,
                        endTime: '24:00'
                    };
                }
            },
            {
                label: '昨天',
                value: 'Yesterday',
                method: () => {
                    const startDate = moment()
                        .add(-1, 'days')
                        .format('YYYY-MM-DD');
                    const endDate = startDate;

                    this.formSearch = {
                        ...this.formSearch,
                        startDate: startDate,
                        startTime: '00:00',
                        endDate: endDate,
                        endTime: '24:00'
                    };
                }
            },
            {
                label: '最近一月',
                value: 'LastMonth',
                method: () => {
                    const startDate = moment()
                        .add(-30, 'days')
                        .format('YYYY-MM-DD');
                    const endDate = moment().format('YYYY-MM-DD');

                    this.formSearch = {
                        ...this.formSearch,
                        startDate: startDate,
                        startTime: '00:00',
                        endDate: endDate,
                        endTime: '24:00'
                    };
                }
            }
        ];
        this.menuOptions.push(...result);

        // const selectMenu = `${moment().format('MM') - 0}`;
        // this.formSearch.selectMenu = selectMenu;

        // const target = this.menuOptions.find(item => item.value === selectMenu);
        // target && target.method();

        this.getAllOptions();
        this.getList();
    },
    methods: {
        setOrderSortType,

        getSummaries(param) {
            const {columns, data} = param;
            const sums = [];
            columns.forEach((column, index) => {
                if (index === 0) {
                    sums[index] = '合计';
                    return;
                }
                const values = data.map(item => Number(item[column.property]));
                if (column.property === 'money' || column.property === 'total') {
                    sums[index] = values.reduce((prev, curr) => {
                        const value = Number(curr);
                        if (!isNaN(value)) {
                            return prev + curr;
                        } else {
                            return prev;
                        }
                    }, 0);
                    sums[index] = `¥ ${sums[index].toFixed(2)}`;
                } else {
                    // sums[index] = 'N/A';
                    sums[index] = '';
                }
            });

            return sums;
        },
        onClickAddMultiple() {
            this.multipleAddVisible = true;
            this.multipleCreateSelection = [
                {
                    ...dataSourceDefault,
                    itemOutIns: dataSourceDefault.itemOutIns.map(item => ({...item, uuid: uuidv4()})),
                    documentNo: `SR${moment().format('YYYYMMDDHHmmss')}${moment().format('SSS')}`,
                    uuid: uuidv4()
                }
            ];

            this.expands = this.multipleCreateSelection.map(item => item.uuid);
        },
        onChangeTimeRange(value) {
            const target = this.menuOptions.find(item => item.value === value);
            if (target && target.method) {
                target.method();
            }
        },
        onChangeDate(value, type) {
            this.formSearch.selectMenu = 'CustomTime';

            if (type === 'startDate' && !value) {
                this.formSearch = {...this.formSearch, startTime: ''};
            }
            if (type === 'startDate' && value && !this.formSearch.startTime) {
                this.formSearch = {...this.formSearch, startTime: '00:00'};
            }
            if (type === 'endDate' && !value) {
                this.formSearch = {...this.formSearch, endTime: ''};
            }
            if (type === 'endDate' && value && !this.formSearch.endTime) {
                this.formSearch = {...this.formSearch, endTime: '24:00'};
            }
        },
        getAllOptions() {
            const newItem = {
                page: 1,
                pageSize: 1000
            };
            getPersons({
                isDeleted: false,
                type: '5',
                sort: '-date',
                select: '_id name -operator',
                ...newItem
            })
                .then(({data: res}) => {
                    this.optionsPersons = res.data;
                    return res.data;
                })
                .catch(error => {
                    console.error('error', error);
                });
            getCustomers({...newItem, isDeleted: false})
                .then(({data: res}) => {
                    this.optionsCustomers = res.data;
                    return res.data;
                })
                .catch(error => {
                    console.error('error', error);
                });
            getProjects(newItem)
                .then(({data: res}) => {
                    this.optionsProjects = res.data;
                    return res.data;
                })
                .catch(error => {
                    console.error('error', error);
                });
            getAccounts(newItem)
                .then(({data: res}) => {
                    this.optionsAccounts = res.data;
                    return res.data;
                })
                .catch(error => {
                    console.error('error', error);
                });
            getDepots({...newItem, isDeleted: false})
                .then(({data: res}) => {
                    this.optionsDepots = res.data;
                    return res.data;
                })
                .catch(error => {
                    console.error('error', error);
                });
        },
        indexMethod(index) {
            return index + 1 + (this.formSearch.page - 1) * this.formSearch.pageSize;
        },
        onRemoveAddSelection(row) {
            this.multipleCreateSelection = this.multipleCreateSelection.filter(({uuid}) => uuid !== row.uuid);
        },
        onRemoveUpdateSelection(row) {
            this.multipleSelection = this.multipleSelection.filter(({uuid}) => uuid !== row.uuid);
            this.multipleValueSelection = this.multipleValueSelection.filter(({uuid}) => uuid !== row.uuid);
            const tRow = this.tableData.find(item => row._id && item._id === row._id);
            tRow && this.$refs.multipleUpdateTable.toggleRowSelection(tRow, false);
        },
        onPushSelection() {
            this.$nextTick(() => {
                const newItem = {
                    ...dataSourceDefault,
                    itemOutIns: dataSourceDefault.itemOutIns.map(item => ({...item, uuid: uuidv4()})),
                    documentNo: `SR${moment().format('YYYYMMDDHHmmssSSS')}`,
                    uuid: uuidv4()
                };
                this.multipleCreateSelection.push(newItem);
                this.expands = [newItem.uuid];
            });
        },
        onRemoveAddExpandSelection(props, row) {
            props.row.itemOutIns = props.row.itemOutIns.filter(({uuid}) => uuid !== row.uuid);
        },
        onChangePage(value) {
            this.formSearch = {...this.formSearch, ...value};
            this.getList();
        },
        resetForm() {
            const formSearch = this.$options.data().formSearch;

            this.formSearch = {
                ...this.formSearch,
                ...formSearch
            };
        },
        handleSelectionChange(value) {
            this.multipleValueSelection = value;
            this.multipleSelection = deepCopy(value).map(item => {
                item.uuid = uuidv4();
                return item;
            });
        },
        // 获取列表数据
        getList() {
            this.isLoading = true;
            const formSearch = this.formSearch;

            const newItem = {
                person: formSearch.person || undefined,
                remark: formSearch.remark || undefined,
                depot: formSearch.depot || undefined,
                customer: formSearch.customer || undefined,
                account: formSearch.account || undefined,
                pageSize: formSearch.pageSize,
                page: formSearch.page,
                sort: formSearch.sortType === 'ReverseOrder' ? `-${formSearch.dateType}` : formSearch.dateType
            };

            const dateType = formSearch.dateType;
            if (dateType && (formSearch.startDate || formSearch.endDate)) {
                newItem[dateType] = {};

                if (formSearch.startDate) {
                    newItem[dateType].gte = new Date(
                        `${moment(formSearch.startDate).format('YYYY-MM-DD')} ${formSearch.startTime}`
                    ).getTime();
                }
                if (formSearch.endDate) {
                    newItem[dateType].lt = new Date(
                        `${moment(formSearch.endDate).format('YYYY-MM-DD')} ${formSearch.endTime}`
                    ).getTime();
                }
            }
            const numberType = formSearch.numberType;

            if (numberType && (formSearch.numberStart || formSearch.numberEnd)) {
                newItem[numberType] = {};

                if (formSearch.numberStart) {
                    newItem[numberType].gte = formSearch.numberStart - 0;
                }
                if (formSearch.numberEnd) {
                    newItem[numberType].lte = formSearch.numberEnd - 0;
                }
            }

            if (formSearch.keyValue) {
                newItem[formSearch.keyName] = formSearch.keyValue;
            }
            getApiList(newItem)
                .then(({data: res}) => {
                    if (res.status === 200) {
                        const {data, count, page, pageSize} = res;
                        this.tableData = data;

                        this.formSearch = {...this.formSearch, page, pageSize, count};
                    }
                })
                .catch(error => {
                    this.tableData = [];
                    this.$message({showClose: true, type: 'error', message: `${error.name}: ${error.message}`});
                })
                .finally(() => (this.isLoading = false));
        },

        onClickDetail(row, title) {
            this.title = title;
            this.visibleDetail = true;

            this.dataSourceDetail = {...row};
        }
    }
};
</script>

<style lang="scss" scoped>
.custom-the-datepicker,
.custom-the-select_time,
.custom-the-select_key {
    ::v-deep {
        .el-input__inner {
            padding-left: 10px;
            padding-right: 10px;
        }
    }
}
.textvalue {
    ::v-deep {
        .el-input__inner {
            cursor: text;
            color: #606266;
            padding-left: 10px;
            padding-right: 10px;
        }
    }
}
</style>
